package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** Language数据管理 */
public class LanguageDBModel extends AbstractDBModel<LanguageDBModel, LanguageEntity>
{
    private static LanguageDBModel instance;

    public static LanguageDBModel getInstance() {
        if (instance == null) {
            instance = new LanguageDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "Language.data";
    }

    /** 创建实体 */
    @Override
    protected LanguageEntity MakeEntity(GameDataTableParser parse)
    {
        LanguageEntity entity = new LanguageEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.Module = parse.GetFieldValueToUTF8String("Module");
        entity.Key = parse.GetFieldValueToUTF8String("Key");
        entity.Desc = parse.GetFieldValueToUTF8String("Desc");
        entity.CN = parse.GetFieldValueToUTF8String("CN");
        entity.EN = parse.GetFieldValueToUTF8String("EN");
        return entity;
    }
}
